In variable length coding (VLC), integers are encoded by a prefix and a suffix. For instance, the suffix comprises a varying number of bits carrying binary encoded pay load data. Then, the prefix comprises unary code representing the number of bits which are comprised in the corresponding suffix. A unary code represents a number by a corresponding number of equally valued bits. Thus, half of the bits used for encoding an integer are used for the prefix.
In sequences of integers comprising many contiguous sub-sequences of integers of a default value, each contiguous sub-sequence being followed by a single occurrence of an integer of another value, each of said sub-sequences may be presented by a variable length code of said other values preceded by a variable length code representation of the run, i.e. of the number of times said default value occurs in the contiguous subsequence preceding the coded other value. Optionally, the code may be preceded by a variable length code representation of said default value. This is called run-level coding.
If the integers in the contiguous sub-sequences do not all have a common default value but only a same or constant value within each of the sub-sequences, each of the sub-sequences may be represented by a variable length code of the corresponding constant value preceded by a variable length code representation of the run of said corresponding constant value. This is called run-length coding.
There is an ongoing effort to improve the encoding efficiency related to arbitrary integer sequences.